/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.ebc.icontatos.model;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author linux
 */
@Entity
public class Interesse implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idInteresse;

    private String descricaoInteresse;
    
    @ManyToOne
    private Usuario usuario;

	public Interesse() {
	}

	public Long getIdInteresse() {
		return idInteresse;
	}

	public void setIdInteresse(Long idInteresse) {
		this.idInteresse = idInteresse;
	}

	public String getDescricaoInteresse() {
		return descricaoInteresse;
	}

	public void setDescricaoInteresse(String descricaoInteresse) {
		this.descricaoInteresse = descricaoInteresse;
	}

	public Usuario getUsuario() {
		return usuario;
	}

	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((descricaoInteresse == null) ? 0 : descricaoInteresse.hashCode());
		result = prime * result + ((idInteresse == null) ? 0 : idInteresse.hashCode());
		result = prime * result + ((usuario == null) ? 0 : usuario.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Interesse other = (Interesse) obj;
		if (descricaoInteresse == null) {
			if (other.descricaoInteresse != null)
				return false;
		} else if (!descricaoInteresse.equals(other.descricaoInteresse))
			return false;
		if (idInteresse == null) {
			if (other.idInteresse != null)
				return false;
		} else if (!idInteresse.equals(other.idInteresse))
			return false;
		if (usuario == null) {
			if (other.usuario != null)
				return false;
		} else if (!usuario.equals(other.usuario))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Interesse [idInteresse=" + idInteresse + "]";
	}
 
}
